// pages/pay/pay.js
const {playData} = require("../../utils/util");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    price:0,
    dataList:{},
    user:{},
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(option) {
    // const th = this;
    // const eventChannel = this.getOpenerEventChannel()
    // // 监听acceptDataFromOpenerPage事件，获取上一页面通过eventChannel传送到当前页面的数据
    // eventChannel.on('acceptDataFromOpenerPage', function (data) {
      this.initData();
    // })
  },
  initData() {
    //根据商品id查询价格
    // const id = data.data;
    const user = wx.getStorageSync('user');
    this.setData({
      user: user
    })
    const data = playData;
    let price = Number(playData.price)*100;
    // console.log(Number(playData.price)*100);
    this.setData({
      dataList: data,
      price: price
    })
  },
  onSubmit(){
    
  }
})